@import '@algolia/autocomplete-theme-classic/dist/theme';

// Configuration
@import '../../main/scss/functions';
@import '../../main/scss/variables';
@import '../../main/scss/variables-theme';
@import '../../main/scss/variables-theme-dark';
@import 'bootstrap/scss/variables';
@import 'bootstrap/scss/variables-dark';
@import 'bootstrap/scss/maps';
@import '../../main/scss/mixins';
@import 'bootstrap/scss/utilities';

:root {
  --aa-primary-color-rgb: var(--#{$prefix}primary-rgb);
  --aa-description-highlight-background-color-rgb: var(--#{$prefix}primary-rgb);
  --aa-text-color-rgb: var(--#{$prefix}body-color-rgb);
  --aa-selected-color-rgb: var(--#{$prefix}primary-rgb);
  --aa-background-color-rgb: var(--#{$prefix}body-bg-rgb);
}

.aa-Form { /* stylelint-disable-line */
  background: inherit;
}

.aa-Autocomplete { /* stylelint-disable-line */
  width: 100%;
}

.aa-Panel { /* stylelint-disable-line */
  --aa-panel-max-height: 240px;

  box-shadow: none;
  position: relative;
  top: 0 !important;

  @include media-breakpoint-up(md) {
    --aa-panel-max-height: 360px;
  }
}

.aa-Item { /* stylelint-disable-line */
  padding: 0.25rem 0.5rem;

  mark {
    background: inherit;
    padding: 0 0.075em;
    text-decoration: underline;
  }

  &[aria-selected='true'] {
    background: transparent;

    .aa-ItemWrapper { /* stylelint-disable-line */
      background-color: var(--#{$prefix}primary) !important;
      color: white !important;
    }

    .aa-ItemContentTitle { /* stylelint-disable-line */
      color: white !important;
    }

    .aa-ItemContentDescription { /* stylelint-disable-line */
      color: rgba(255, 255, 255, 0.75) !important;
    }

    mark {
      color: inherit;
    }
  }
}

.aa-ItemIcon { /* stylelint-disable-line */
  height: 100%;
  background: transparent;
  border: none;
  box-shadow: none;
}

.aa-ItemContentDescription { /* stylelint-disable-line */
  white-space: nowrap;
}

.aa-PanelLayout { /* stylelint-disable-line */
  padding: 0;
}

.aa-DetachedSearchButton { /* stylelint-disable-line */
  background: transparent;
  border: none;
  padding: 0;
}

.aa-DetachedSearchButtonIcon { /* stylelint-disable-line */
  width: 1.25rem;
}

.aa-SubmitIcon { /* stylelint-disable-line */
  color: var(--#{$prefix}navbar-color);
}

.aa-DetachedSearchButtonPlaceholder { /* stylelint-disable-line */
  display: none;
}

.aa-noResults { /* stylelint-disable-line */
  padding: 1rem 0.5rem;
  text-align: center;
  background: var(--#{$prefix}secondary);
  color: white;
}
